{notempty name="opt"}
<div class="panel-body">
    <form id="search-form1" class="form-inline" role="form" method="post" action="">
        {foreach name='opt' item="vo"}
        {switch name="vo.type"}
        {case value="hidden"}
        <div class="form-group">
            <input type="hidden" name="{$vo.name}" value="{$vo.value}" id="{$vo.inputid}">
        </div>
        {/case}
        {case value="input"}
        <div class="form-group">
            <input type="text" name="{$vo.name}" value="{$vo.value}" placeholder="{$vo.title}" class="form-control"
                   id="{$vo.inputid}" {$vo.readonly}>
        </div>
        {/case}
        {case value="select"}
        <select name="{$vo.name}" class="form-control" style="width:196px">
            {foreach name="vo.option" item="v" key='k'}
            <option value="{$k}" {eq name="k" value="$vo.value"}selected{/eq} >{$v}</option>
            {/foreach}
        </select>
        {/case}
        <default/>
        {/switch}
        {/foreach}
        <button class="btn btn-default btn-success" id="cha">查询
            {notempty name="search"}
            <button class="btn btn-default btn-success" id="daochu" type="button" style="margin-left:10px;">导出数据
            </button>
            {/notempty}
        </button>
    </form>
</div>
{/notempty}
<script>
    var start = {
        elem: '#start',
        format: 'YYYY-MM-DD hh:mm:ss',
        min: '2010-01-01 00:00:00', //设定最小日期为当前日期
        max: '2099-12-31 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end',
        format: 'YYYY-MM-DD hh:mm:ss',
        min: '2010-01-01 00:00:00', //设定最小日期为当前日期
        max: '2099-12-31 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    $("#begin").click(function () {
        laydate(start);
    });

    $("#end").click(function () {
        laydate(end);
    });

    $('#cha').click(function () {
        $('#search-form1').attr('action', '');
        $('#search-form1').submit();
    });

    $('#daochu').click(function () {
        var search = "{$search}";
        $('#search-form1').attr('action', search);
        $('#search-form1').submit();
    });
</script>